package com.hxkj.controller;

import com.hxkj.service.KuaijiePayService;
import com.hxkj.service.AliPayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * Create by chenwei on 2019/1/15 14:42
 */
@RestController
@Slf4j
@RequestMapping("/notify")
public class NotifyController {

    @Resource
    private AliPayService paymentService;

    @Resource
    private KuaijiePayService kuaijiePayService;


    @PostMapping("/recharge/alipay")
    public void aliPayRecharge() throws Exception {
        paymentService.payCallback();
    }

    @PostMapping("/recharge/kuaijie")
    public void kuaijieRecharge() throws Exception {
        kuaijiePayService.payCallback();

    }

    @PostMapping("/withdraw/alipay")
    public void aliPayWithdraw(@RequestParam Map<String, String> params) {
//        paymentService.nodify();
    }

    @PostMapping("/withdraw/kuaijie")
    public void notifyPay() throws Exception {
        kuaijiePayService.withdrawCallback();

    }
}
